import os

pid = os.fork()

if pid < 0:
    print('Error')
elif pid == 0:
    # 1136
    print('Child PID:', os.getpid())
    # 获取父进程ID 1135
    print('Get parent PID:', os.getppid())
else:
    # 1135
    print('Parent PID:', os.getpid())
    # 1136
    print('Get child PID:', pid)
